import https from './request';
const http = (data = {
    url: "",
    method: "",
    params: {}
}) => {
    return new Promise((resolve, reject) => {
        switch (data.method) {
            case "get":
                https.get(data.url, { params: data.params }).then(res => {
                    resolve(res)
                });
                break;
            case 'post':
                https.post(data.url, data.params).then(res => {
                    resolve(res)
                });
                break;
            default:
                break;
        }
    })
}

export default http